<template>
  <div id="app">
    <van-nav-bar
      v-if="$route.meta.rightText"
      :title="$route.meta.title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      :right-text="$route.meta.rightText"
      @click-right="onClickRight"
    />
    <van-nav-bar
      v-else
      :title="$route.meta.title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <router-view />
  </div>
</template>
<script>
export default {
  methods: {
    onClickLeft () {
      this.$router.go(-1);
    }
  }
}
</script>
<style>
body {
  background-color: #fafafa;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  /* background-color: #fafafa */
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
